﻿using Slex;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Test.Scenes {
    public partial class ViewTreeHelper1 : UserControl {
        public ViewTreeHelper1() {
            InitializeComponent();
            this.Loaded += ViewTreeHelper1_Loaded;
        }

        void ViewTreeHelper1_Loaded(object sender, RoutedEventArgs e) {
            //var x=this.GetChildObject<TextBlock>("tb11");
            //var x = this.FindName("tb11") as TextBlock;
            //MessageBox.Show(x.Text.ToString());
            List<FrameworkElement> x2 = this.LayoutRoot.GetChildObjects();
            var sb = new StringBuilder();
            foreach (var item in x2) {
                sb.AppendLine(string.Format("name is {0} and type name is {1}", item.Name, item.GetType().Name));
            }
            MessageBox.Show(sb.ToString());

        }
    }
}
